<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ include file="/common/taglibs.jsp" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>客户信息增修</title>
    <%@ include file="/common/util.jsp" %>
    <%@ include file="/common/meta.jsp" %>
    <script src="${cdnctx}/dep/Calendar/WdatePicker.js" type="text/javascript"></script>
    <script src="${cdnctx}/dep/artDialog/jquery.artDialog.js?skin=default"></script>
    <style type="text/css">
        .ms-container {
            width: 668px;
        }

        .etypeh {
            background-color: #08c;
            color: white;
        }
    </style>
    <script type="text/javascript">
        //Form 验证
        $(document).ready(function () {
            //设置电价类型多选项
            $("#etype").multiSelect({
                selectableHeader: "<div class='etypeh' align='center' >未选择</div>",
                selectionHeader: "<div class='etypeh' align='center'>已选择</div>"
            });
            //$("#etype").multiSelect();
            $("#etype").multiSelect("deselect_all");
            var etypeListStr = "${customerInfo.etype}";
            var etypeCodeArray = etypeListStr.split(",");
            for (var i = 0; i < etypeCodeArray.length; i++) {
                $("#etype").multiSelect('select', etypeCodeArray[i]);
            }
            $("#customerinfo").validate({
                // debug: true,
                rules: {
                    'companycode': {
                        required: true,
                        digits: true,
                        existCompanyCode: [$("#id").val()]
                    },
                    'lastpaydate': {
                        // required: true,
                        // digits: true,
                        range: [1, 31]
                    },
                    'customername': {
                        required: true
                    },
                    'architecturetype':{
                        required:true
                    } ,
                    'customerinfotype':{
                        required:true
                    }
                },
                messages: {
                    'companycode': {
                        required: "公司番号",
                        digits: "请输入合法的番号格式"
                    },
                    // 'lastpaydate': {
                    // 	digits: "请输入1-31的缴费日期",
                    // 	range: "请输入1-31的缴费日期"
                    // },
                    'customername': {
                        required: "公司名称"
                    },
                    'architecturetype':{
                        required:'建筑类型'
                    },
                    'customerinfotype':{
                        required:'客户类型'
                    }
                }
            });

            for (var i = 1; i < 12; i++) {
                $("#id" + i).removeClass("current");
            }
            $("#id8").addClass("current");
        });
        //返回
        function goback() {
            self.location = "${cdnctx}/system/customerinfo/customerMain.shtml?";
        }
    </script>
</head>

<body class="main">
<div class="-frame -style -luster" id="css_container">

    <!--首页框架页眉部分↓-->
    <%@ include file="/WEB-INF/pages/inc/header.jsp" %>
    <!--首页框架页眉部分↑-->

    <div class="content">
        <!-- Left导航菜单◎开始 -->
        <%@ include file="/WEB-INF/pages/inc/leftmenu.jsp" %>
        <!-- Left导航菜单◎结束 -->

        <div class="main-mid">
            <div class="pos"><img src="${cdnctx}/src/index/img/index.png"><a
                    href="<%--${cdnctx}/system/systemMenu.shtml--%>">系统管理 ></a><a
                    href="${cdnctx}/system/customerinfo/customerMain.shtml">公司信息管理 </a>><a><c:choose> <c:when
                    test="${customerInfo.id == null}">新增</c:when><c:otherwise>编辑</c:otherwise></c:choose></a></div>
            <div class="css_contentDiv">
                <form id="customerinfo" action="save.shtml" method="post">
                    <input type="hidden" id="id" name="id" value="${customerInfo.id}"/>

                    <div class="searchDetailed  c-border-radius  b-box-shadow">
                        <table width="100%" align="center" border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td width="100" height="30" align="right" style="font-size: 10pt;">
                                    所属集团:&nbsp;</td>
                                <td width="160" align="left">
                                    <select name="groupcode" id="groupcode" class="form_select normal">
                                        <option value="">请选择</option>
                                        <c:forEach items="${groupList}" var="entity" varStatus="status">
                                            <option value="${entity.groupcode}"
                                                    <c:if test="${entity.groupcode==customerInfo.groupcode}">selected</c:if>>${entity.groupname}</option>
                                        </c:forEach>
                                    </select>
                            </tr>
                            <tr>
                                <td width="80" height="30" align="right" style="font-size: 10pt;">
                                    <font color="red">*</font>公司番号:&nbsp;</td>
                                <td width="240" align="left">
                                    <input type="text" id="companycode" name="companycode"
                                           value="${customerInfo.companycode}" class="form_input normal"/>
                                </td>
                                <td width="80" align="right" style="font-size: 10pt;">
                                    <font color="red">*</font>公司名:&nbsp;</td>
                                <td width="300" align="left">
                                    <input type="text" id="customername" name="customername"
                                           value="${customerInfo.customername}" class="form_input normal"/>
                                </td>
                            </tr>
                            <tr>
                                <td width="80" height="30" align="right" style="font-size: 10pt;">联络人:&nbsp;</td>
                                <td width="240" align="left">
                                    <input type="text" id="contact" name="contact" value="${customerInfo.contact}"
                                           class="form_input normal">
                                </td>
                                <td width="80" align="right" style="font-size: 10pt;">联络人职务:&nbsp;</td>
                                <td width="240" align="left">
                                    <input type="text" id="contactduty" name="contactduty"
                                           value="${customerInfo.contactduty}" class="form_input normal">
                                </td>
                            </tr>
                            <tr>
                                <td width="80" height="30" align="right" style="font-size: 10pt;">座机:&nbsp;</td>
                                <td width="120" align="left">
                                    <input type="text" id="tel" name="tel" value="${customerInfo.tel}"
                                           class="form_input normal">
                                </td>
                                <td width="80" align="right" style="font-size: 10pt;">手机:&nbsp;</td>
                                <td width="120" align="left">
                                    <input type="text" id="mobile" name="mobile" value="${customerInfo.mobile}"
                                           class="form_input normal">
                                </td>
                            </tr>
                            <tr>
                                <td width="80" height="30" align="right" style="font-size: 10pt;">
                                    维护费:&nbsp;</td>
                                <td width="120" align="left">
                                    <input type="text" id="maintenanceprice" name="maintenanceprice"
                                           value="${customerInfo.maintenanceprice}" class="form_input normal">
                                </td>
                                <td width="120" align="right" style="font-size: 10pt;">
                                    未计时约定费用:&nbsp;</td>
                                <td width="120" align="left">
                                    <input type="text" id="conventionprice" name="conventionprice"
                                           value="${customerInfo.conventionprice}" class="form_input normal">
                                </td>
                            </tr>
                            <tr>
                                <td width="120" height="30" align="right" style="font-size: 10pt;">点灯预警时间:&nbsp;</td>
                                <td width="120" align="left">
                                    <input type="text" id="warningtype" name="warningtype"
                                           value="${customerInfo.warningtype}" class="form_input normal">
                                </td>
                                </td>
                                <td width="120" height="30" align="right" style="font-size: 10pt;">点灯预警标记:&nbsp;</td>
                                <td width="120" align="left">
                                    <input type="radio" id="warningflag" name="warningflag" value="1"
                                           <c:if test="${1 == customerInfo.warningflag}">checked</c:if> >开启&nbsp;&nbsp;</input>
                                    <input type="radio" id="warningflag" name="warningflag" value="0"
                                           <c:if test="${0 == customerInfo.warningflag}">checked</c:if> >关闭</input>
                                </td>
                            </tr>
                            <tr>
                                <td width="80" align="right" style="font-size: 10pt;">分享比例(%):&nbsp;</td>
                                <td width="120" align="left">
                                    <input type="text" id="copeproportion" name="copeproportion"
                                           value="${customerInfo.copeproportion}" class="form_input normal">
                                </td>
                                <td width="120" height="30" align="right" style="font-size: 10pt;">
                                    最后交费日期:&nbsp;</td>
                                <td width="120" align="left">
                                    <input id="lastpaydate" type="text" class="form_input normal" name="lastpaydate"
                                           value="${customerInfo.lastpaydate}">（输入每月几日）
                                </td>
                            </tr>
                            <tr>
                                <td width="80" align="right" style="font-size: 10pt;">积分上限:&nbsp;</td>
                                <td width="120" align="left">
                                    <input type="text" id="maxpoint" name="maxpoint" alue="${customerInfo.maxpoint}"
                                           class="form_input normal">
                                </td>
                                <td width="120" height="30" align="right" style="font-size: 10pt;">奖励积分:&nbsp;</td>
                                <td width="120" align="left">
                                    <input type="text" id="bonuspoint" name="bonuspoint"
                                           value="${customerInfo.bonuspoint}" class="form_input normal"/>
                                </td>
                            </tr>
                            <tr>
                                <td width="80" align="right" style="font-size: 10pt;">员工数(人):&nbsp;</td>
                                <td width="120" align="left">
                                    <input type="text" id="employeenum" name="employeenum"
                                           value="${customerInfo.employeenum}" class="form_input normal">
                                </td>
                                <td width="120" height="30" align="right" style="font-size: 10pt;">办公面积(m²):&nbsp;</td>
                                <td width="120" align="left">
                                    <input type="text" id="square" name="square" value="${customerInfo.square}"
                                           class="form_input normal"/>
                                </td>
                            </tr>
                            <tr>
                                <td width="80" align="right" style="font-size: 10pt;">预计节能目标:&nbsp;</td>
                                <td width="120" align="left">
                                    <input type="text" id="savetarget" name="savetarget"
                                           value="${customerInfo.savetarget}" class="form_input normal">
                                </td>
                                <td width="120" height="30" align="right" style="font-size: 10pt;">预计节约费用:&nbsp;</td>
                                <td width="120" align="left">
                                    <input type="text" id="moneysavetarget" name="moneysavetarget"
                                           value="${customerInfo.moneysavetarget}" class="form_input normal"/>
                                </td>
                            </tr>
                            <tr>
                                <td width="80" height="30" align="right" style="font-size: 10pt;">Email:&nbsp;</td>
                                <td align="left">
                                    <input type="text" id="email" name="email" size="77" value="${customerInfo.email}"
                                           class="form_input normal">
                                </td>
                                <td width="120" height="30" align="right" style="font-size: 10pt;">客户类型:&nbsp;</td>
                                <td width="120" align="left">
                                    <input type="radio" id="customerinfotype" name="customerinfotype" value="1"
                                           <c:if test="${1 == customerInfo.customerinfotype}">checked</c:if> >节能&nbsp;&nbsp;</input>
                                    <input type="radio" id="customerinfotype" name="customerinfotype" value="2"
                                           <c:if test="${2 == customerInfo.customerinfotype}">checked</c:if> >能源</input>
                                </td>
                            </tr>
                            <tr>
                                <td width="80" height="30" align="right" style="font-size: 10pt;">地址:&nbsp;</td>
                                <td width="120" align="left" >
                                    <input type="text" id="address" name="address" size="77"
                                           value="${customerInfo.address}" class="form_input normal">
                                </td>
                                <td width="120" height="30" align="right" style="font-size: 10pt;">建筑类型:&nbsp;</td>
                                <td width="160" align="left">
                                    <select name="architecturetype" id="architecturetype" class="form_select normal">
                                        <option value="">请选择</option>
                                        <c:forEach items="${architectureList}" var="architecture" varStatus="status">
                                            <option value="${architecture.id}"
                                                    <c:if test="${architecture.id==customerInfo.customerinfotype}">selected</c:if>>${architecture.architecturename}</option>
                                        </c:forEach>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td width="80" height="30" align="right" style="font-size: 10pt;">电价类型:&nbsp;</td>
                                <td width="120" align="left" colspan="5">
                                    <select name="etype" id="etype" multiple="multiple" size="4" class="form_select">
                                        <c:forEach items="${lstuntice}" var="lstuntice" varStatus="status">
                                            <option value="${lstuntice.epricecode}">单价(元)：${lstuntice.unitprice}&nbsp;&nbsp;&nbsp;&nbsp;${lstuntice.stime}~${lstuntice.etime}
                                            </option>
                                        </c:forEach>
                                    </select>
                                </td>
                                </td>
                            </tr>
                            <tr>
                                <td width="80" height="30" align="right" style="font-size: 10pt;">备注:&nbsp;</td>
                                <td width="80" align="left" colspan="5">
                                    <br/>
                                    <textarea id="memo" name="memo" rows="4" cols="77" class="form_textarea"
                                              style="width:668px;">${customerInfo.memo}</textarea>
                                </td>
                            </tr>
                            <tr>
                                <td></td>
                                <td height="40">
                                    <input id="newbutton" type="submit" class="form_save" value="保&nbsp;存"/>
                                    <input id="searchbutton" type="reset" class="form_cancle" onclick="goback();"
                                           value="返&nbsp;回">
                                </td>
                            </tr>
                        </table>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <!--首页框架页尾部分↓-->
    <%@ include file="/WEB-INF/pages/inc/footer.jsp" %>
    <!--首页框架页尾部分↑-->


</div>
</body>
</html>